package Interface;

import java.util.ArrayList;
//对第一套业务进行实现
public class StudentOperatelmpl1  implements StudentOperate{
    @Override
    public void printALLInfo(ArrayList<Student> students) {
        System.out.println("=======全班全部学生信息如下=======");
        for (int i = 0; i < students.size(); i++) {
            Student s = students.get(i);
            System.out.println("姓名："+ s.getName()+"性别："+s.getSex()+"成绩："+s.getScore());
        }
        System.out.println("===============");
    }

    @Override
    public void printAverageScore(ArrayList<Student> students) {
        double allscore = 0.0;
        for (int i = 0; i < students.size(); i++) {
            Student s = students.get(i);
            allscore += s.getScore();
        }
        System.out.println("平均分："+(allscore) / students.size());
    }
}
